package dao

import (
	utils "hft/Http/Utils"

	"gorm.io/gorm"
)

type FeedBack struct{}

func (f *FeedBack) GetAccountFeedBackList(accountId int, paginate *utils.Page, db *gorm.DB) func(db *gorm.DB) *gorm.DB {

	return func(db *gorm.DB) *gorm.DB {
		return db.Where("account_id = ?", accountId).Scopes(Paginate(Page(*paginate), db)).Order("create_time DESC")
	}
}

func (f *FeedBack) GetAllFeedBackList(paginate *utils.Page, db *gorm.DB) func(db *gorm.DB) *gorm.DB {

	return func(db *gorm.DB) *gorm.DB {
		return db.Scopes(Paginate(Page(*paginate), db)).Order("create_time DESC")
	}
}

var FeedBackDao = new(FeedBack)
